home *** CD-ROM | disk | FTP | other *** search
- ;void locate(col,row);
- ; unsigned char col,row;
-
- EXTRN _memory_model:byte
- EXTRN _video_page:byte
-
- _TEXT SEGMENT BYTE PUBLIC 'CODE'
- ASSUME CS:_TEXT
- PUBLIC _locate
- _locate proc near
- push bp ;save BP
- mov bp,sp ;set stack frame
- cmp _memory_model,0 ;near or far?
- jle begin ;jump if near
- inc bp ;else add 2 to BP
- inc bp ;
- begin: mov bh,_video_page ;set the page
- mov dh,[bp+6] ;get the row
- dec dh ;count from 0
- mov dl,[bp+4] ;get the column
- dec dl ;count from 0
- mov ah,2 ;function to set cursor
- int 10h ;set the cursor
- pop bp ;restore BP
- L1: cmp _memory_model,0 ;quit
- jle quit ;
- db 0CBh ;RET far
- quit: ret ;RET near
- _locate endp
- _TEXT ENDS
- END